/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.sunspotworld;

/**
 *
 * @author me
 */
public class Saver extends Thread {

    int PDELAY=1;   //ms
    int PTRIALS = 100;

    Bank bank;
    public Saver(Bank bank) {
        this.bank = bank;
    }
    public void run(){
        try
        {
            for (int i = 0; i < PTRIALS; i++)
            {
                 System.out.println("Save #" +i);
                 bank.deposit(100);
                 Thread.sleep(PDELAY);
            }
         } catch (InterruptedException e) {
         }
    }
}